文章背景与核心概要
在《构建 Foundry》系列的第三部分中,我们迎来了将混乱、无序的创意归档转变为完全可搜索库的最终解决方案。在不修改或重命名原始源文件的基础之上,Foundry 能够扫描目录、构建基于内容哈希的清单(manifest)、准备丰富的元数据,并将资产与 Weaviate 进行同步。这使得强大的关键词、语义和混合搜索工作流成为可能,允许团队根据意图和内容(而不是僵化的文件夹结构)来重新发现过去的工作成果。
本文详细分步阐述了 Foundry 从无损扫描、元数据准备、Weaviate 向量化同步到最终多模态检索的完整落地过程,为解决创意资产管理的痛点提供了一套切实可行的工程实践范本。
Summary In Building Foundry Part 3, we construct the final solution to transform messy, unorganized creative archives into fully searchable libraries. Without modifying or renaming original source files, Foundry scans directories, builds content-hashed manifests, prepares rich metadata, and synchronizes assets with Weaviate. This enables powerful keyword, semantic, and hybrid search workflows, allowing teams to rediscover past work based on intent and content rather than rigid folder structures.
Building Foundry Part 3: From archive to creative search
构建 Foundry
一系列关于创意工作流、语义搜索与 Weaviate 的实战连载。Building Foundry
A practical series on creative workflows, semantic search, and Weaviate.
阅读本系列的上一篇文章:第二部分:创意工作流崩溃的地方。
Read the previous post in the series: Part 2: Where creative workflows break.
第一部分介绍了问题所在。第二部分展示了随着归档文件不断增加,熟悉的组织工作方式变得越来越不可靠的原因。现在,我们将着手构建解决方案。
Part 1 introduced the problem. Part 2 showed why familiar ways of organising work become less reliable as an archive grows. Now we are going to build the solution.
Foundry 将现有的归档文件转变为可搜索的创意库。它扫描文件、记录发现的内容、为每个资产的检索做好准备,并将结果同步到 Weaviate。没有任何文件被移动或重命名。每个搜索结果仍然直接指向其原始来源。
Foundry turns an existing archive into a searchable creative library. It scans the files, records what it finds, prepares each asset for retrieval, and synchronises the result with Weaviate. Nothing is moved or renamed. Every result still leads back to its original source.
creative archive
↓
read-only scanner
↓
manifest and descriptions
↓
Weaviate collection
↓
keyword, semantic, or hybrid search
↓
source asset
从我们已有的归档开始
Starting with the archive we already have
我们的测试归档包含来自五个虚构项目的 23 个资产。其中包含概念艺术、设计导出品、制作笔记、音频、视频和参考图像。
Our test archive contains 23 assets from five fictional projects. Inside are concept art, design exports, production notes, audio, video, and reference images.
这些文件名故意取得杂乱无章:
The names are deliberately inconsistent:
final_FINAL_v7.svg
BROLL_NEW2.svg
scene_14_USE_THIS.svg
logo_options_FINAL3.svg
bridge_texture.svg
这种混乱是刻意为之的。Foundry 应该适用于团队今天拥有的归档,而不是那种可能永远没时间创建的完美组织归档。
That mess is intentional. Foundry should be useful with the archive a team has today, not the perfectly organised archive it may never have time to create.
第一步:在不更改源文件的情况下进行扫描
Step 1: Scan without changing the source
Foundry 从只读扫描开始。它遍历选定的文件夹并记录有关每个受支持文件的信息。
Foundry begins with a read-only scan. It walks the selected folder and records facts about every supported file.
npm install
npm run demo
扫描器捕获源路径、项目、文件类型、大小、修改日期和内容哈希。它将结果写入 output/manifest.json。
The scanner captures the source path, project, file type, size, modified date, and a content hash. It writes the result to
output/manifest.json.

内容哈希赋予了每个资产稳定的身份标识。这使得 Foundry 即使在文件名保持不变的情况下也能检测到更改,并在没有任何内容改变时跳过处理工作。
The content hash gives each asset a stable identity. It lets Foundry detect changes even when a filename stays the same and skip work when nothing has changed.
浏览器将该清单转化为可视化的界面。图像带有预览,视频可以播放,文档无需缩略图也清晰可见。
The browser turns that inventory into something visual. Images have previews, videos can be played, and documents remain visible without thumbnails.
这个最初的检查点非常重要,因为搜索引擎无法找到扫描器漏掉的东西。
This first checkpoint matters because search cannot find what the scanner missed.
第二步:为检索准备记录
Step 2: Prepare records for retrieval
清单告诉我们存在什么。下一步是描述这些文件包含的内容。
The manifest tells us what exists. The next step is to describe what those files contain.
准备阶段会添加描述、标签、提取的文本、关系角色和源 URI。一个准备就绪的图像记录如下所示:
The preparation stage adds descriptions, tags, extracted text, relationship roles, and a source URI. A prepared image record looks like this:
{
"fileName": "rain-floor.jpg",
"relativePath": "RAIN TRAILER/References/rain-floor.jpg",
"project": "RAIN TRAILER",
"assetType": "image",
"relationshipRole": "reference",
"description": "Heavy rain striking a reflective floor with bright droplets and bokeh.",
"tags": ["rain", "wet floor", "reflection", "atmosphere"],
"sourceUri": "foundry://RAIN TRAILER/References/rain-floor.jpg"
}
foundry:// URI 指向资产本身,而无需将 Weaviate 用作文件存储。生产版本可以使用 DAM 链接、挂载路径、S3 URL 或应用程序路由。
The
foundry://URI points back to the asset without treating Weaviate as file storage. A production version could use a DAM link, mounted path, S3 URL, or application route.
目前,该演示使用了一个小型丰富化清单(enrichment manifest),以便每次运行都产生相同的结果。后续版本可以从图像标题、OCR、转录文本和视频关键帧中生成这些上下文。
For now, the demo uses a small enrichment manifest so every run produces the same result. Later versions can generate this context from image captions, OCR, transcripts, and video keyframes.
第三步:与 Weaviate 同步
Step 3: Synchronise with Weaviate
在同步之前,Foundry 会准确展示将要索引的内容。用户可以在任何内容到达 Weaviate 之前检查描述、元数据和源路径。
Before synchronisation, Foundry shows exactly what will be indexed. The user can review descriptions, metadata, and source paths before anything reaches Weaviate.

然后,应用程序创建或更新 Foundry 集合(collection)。Weaviate 生成嵌入(embeddings)并将它们与元数据存储在一起。每个对象都保留其源路径和权限状态。
The application then creates or updates the
Foundrycollection. Weaviate generates embeddings and stores them beside the metadata. Each object keeps its source path and rights status.

再次运行该过程不会创建重复项。确定性的标识符确保每个资产都更新同一个对象。
Running the process again does not create duplicates. Deterministic identifiers ensure that each asset updates the same object.
可以通过命令行使用相同的工作流:
The same workflow is available from the command line:
npm run scan
npm run ingest:prepare
npm run ingest:cloud
云凭证保存在本地的 .env 文件中:
Cloud credentials stay in a local
.envfile:
WEAVIATE_URL=https://your-cluster.weaviate.network
WEAVIATE_API_KEY=replace-with-a-read-write-api-key
WEAVIATE_COLLECTION=Foundry
第四步:搜索归档
Step 4: Search the archive
同步完成后,归档文件将变成一个实时的搜索工作区。
Once synchronisation finishes, the archive becomes a live search workspace.
第一个测试查询描述起来很简单,但很难映射到文件名:
The first test query is easy to describe but hard to map to a filename:
white rabbit in a grassy landscape

结果包括一只兔子的参考图、《Big Buck Bunny》预告片以及相关的风景图像。无需记住文件名或文件夹。用户只需描述他们所记住的内容,Foundry 就会将相关的工作成果带回视野中。
The results include a rabbit reference, the Big Buck Bunny trailer, and related landscape imagery. There is no need to remember a filename or folder. The user describes what they remember and Foundry brings the relevant work back into view.
Foundry 提供了三种检索模式:
Foundry exposes three retrieval modes:
keyword → exact words and names
semantic → meaning represented by embeddings
hybrid → keyword and semantic signals combined
当某人记得文件名或制作术语时,关键词搜索(Keyword search)就会派上用场。当他们记得内容时,语义搜索(Semantic search)就会发挥作用。混合搜索(Hybrid search)则将这两种记忆结合到一个结果集中。
Keyword search works when someone remembers a filename or production term. Semantic search works when they remember the content. Hybrid search brings both kinds of memory into one result set.
过滤器使这些结果更具实用性。用户可以按项目、文件类型或关系角色缩小归档范围。同样的模式还可以支持审批状态、版权、过期时间和交付格式。
Filters make those results practical. Users can narrow the archive by project, file type, or relationship role. The same pattern can support approval status, rights, expiry dates, and delivery formats.
构建验证了什么
What the build proves
该原型现在完成了从源文件夹到实用结果的整个旅程:
The prototype now completes the journey from source folder to useful result:
- 它扫描嵌套的归档文件而不改变源文件。
- 它创建稳定的记录并通过内容哈希检测更改。
- 它在摄入前丰富记录,而不是仅仅依赖文件名。
- 它将可搜索的记录和托管嵌入存储在 Weaviate 中。
- 它在同一归档上对比了关键词、语义和混合检索。
- 它返回带有返回源文件链接的图像和视频。
- It scans a nested archive without changing the source files.
- It creates stable records and detects changes with content hashes.
- It enriches records before ingestion instead of relying on filenames alone.
- It stores searchable records and managed embeddings in Weaviate.
- It compares keyword, semantic, and hybrid retrieval on the same archive.
- It returns images and video with links back to their source.
Foundry 仍然是一个原型。自动化丰富化、增量重新扫描、感知权限的过滤以及相关性反馈将是该项目的下一个更新方向。
Foundry is still a prototype. Automatic enrichment, incremental rescans, rights-aware filtering, and relevance feedback would be the next update to the project.
运行 Foundry
Run Foundry
该项目可在 GitHub 上获取。
The project is available on GitHub.
cp .env.example .env
# 添加你的 Weaviate 云端 URL 和 API 密钥
# Add your Weaviate Cloud URL and API key
npm install
npm run demo
云同步和实时搜索建议使用 Node.js 22 或更高版本。本地清单在没有云凭证的情况下也可以运行。
Use Node.js 22 or newer for cloud synchronisation and live search. The local inventory can run without cloud credentials.
提示
探索 Foundry 仓库并按照 README 扫描示例归档,或者连接你自己的 Weaviate Cloud 集合。Tip
Explore the Foundry repository and follow the README to scan the sample archive or connect your own Weaviate Cloud collection.
从隐藏文件到有价值的历史记录
From hidden files to useful history
Foundry 始于一个熟悉的创意挫折:只记得做过这项工作,却不记得它存在哪里。
Foundry began with a familiar creative frustration: remembering the work but not where it lives.
它并没有取代该工作背后的文件夹、工具或习惯。它为归档提供了一种展现其自身价值的新方式。曾经依赖正确文件名、文件夹或同事的资产,现在可以通过其背后的创意被重新找回。
It does not replace the folders, tools, or habits behind that work. It gives the archive a new way to reveal itself. An asset that once depended on the right filename, folder, or colleague can now be found through the idea behind it.
归档不再是已完成工作消失的地方,它重新变成了宝贵的创意素材。
The archive stops being a place where finished work disappears. It becomes creative material again.
准备好开始构建了吗?
Ready to start building?
查看快速入门教程,或者注册免费的 Weaviate Cloud 账户。
Check out the Quickstart tutorial, or sign up for a free Weaviate Cloud account.